<template>
  <div>
        欢迎光临_vue开发的收银系统_水果店
        <br>
 
      <h4> 苹果 10￥/斤,折扣8折</h4>
        
       请输入你要购买的斤数 <input  v-model="input" type="number">
        <br>
       <button @click="pay">结帐买单~</button>
       <br>
       结帐单:总价:{{total}}￥元 折后价:{{discount}}￥元 省了:{{economize}}￥元
  </div>
</template>

<script>
export default {
  data() {
    return{
      total:0,
      discount:0,
      economize:0,
      input:''
    }
  },
  methods:{
      pay(){
        this.total=this.input*10
        this.discount = this.total * 0.8
        this.economize = this.total - this.discount
      }
  }
};
</script>

<style>

</style>